package shun.demo.binder;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.widget.ImageView;
import shun.demo.R;

/**
 * Created with IntelliJ IDEA.
 * User: chen
 * Date: 9/30/13
 * Time: 12:04 PM
 * To change this template use File | Settings | File Templates.
 */
public class BinderService extends Service {
    private IBinder mBinder;
    private FloatWindow mWindow;
    public IBinder onBind(Intent intent) {
        return mBinder;
    }


    @Override
    public void onCreate() {
        super.onCreate();
        mBinder = new MyBinder();
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {

        return super.onStartCommand(intent, flags, startId);
    }

    public class MyBinder extends TestBinder.Stub {

        private String name;
        @Override
        public String getName() throws RemoteException {
            return name;
        }

        @Override
        public void setName(String name) throws RemoteException {
            this.name = name;
        }
    }
}
